package com.example.tys.gif;

import android.graphics.Bitmap;

/**
 * Created by tys on 2017/9/16.
 */

public class GifProcess {

    private final long gifPoint;

    public GifProcess(String path) {
        this.gifPoint = loadGif(path);
    }

    /**
     * jni加载gif文件
     *
     * @param path
     * @return c指针
     */
    private native long loadGif(String path);

    private native int getWidth(long gifPoint);

    private native int getHeight(long gifPoint);

    //绘制函数
    private native int updateFrame(Bitmap bitmap, long gifPoint);

    public int getWidth() {
        return getWidth(gifPoint);
    }

    public int getHeight(){
        return getHeight(gifPoint);
    }

    public  int updateFrame(Bitmap bitmap){
        return updateFrame(bitmap, gifPoint);
    }
}
